package com.web.FourthService.Service.Imp;

import com.web.FourthService.Service.FourthService;
import com.web.FourthService.mappers.usemapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Slf4j
@Service
public class FourthServiceImp implements FourthService {
    @Autowired
    usemapper usemapper;

    @Override
    @Transactional
    public void subtractCart(Integer id, int number) {
        log.info("开始减库存");
        usemapper.subtractCartNum(id, number);
        log.info("扣减成功");
    }
}
